<!DOCTYPE  html>
<html>
{include file="head.html"}
<body>
<div class="tabs-border">
	<a class="item active" href="admin.php?m=user">用户管理</a>
	<a class="item" href="admin.php?m=user&a=add">用户添加</a>
</div>
<div class="main-body">
	 
   
    <div class="pd-5 cl2"> 共{$rscount}条记录</div>
    
    <form method="get" action="{$appadmin}" class="search-form">
    <input type="hidden" name="m" value="user" />
    userid:<input type="text" name="userid" value="{$smarty.get.userid|intval}" class="w60" />
    昵称：<input type="text" name="nickname" value="{$smarty.get.nickname|html}" class="w100"  />
    电话：<input type="text" name="telephone" value="{$smarty.get.telephone|html}" class="w100" />
    状态：<select name="bstatus"  class="w100">
		 <option value="">请选择</option>
		 <option {if get('bstatus') eq 'new'}selected{/if} value="new">未审核</option>
		 <option {if get('bstatus') eq 'pass'}selected{/if}  value="pass">已通过</option>
		 <option {if get('bstatus') eq 'forbid'}selected{/if}  value="forbid">已禁止</option>
	</select>
	排序：<select name="orderby" class="w100">
    	<option value="userid DESC">注册</option>
    	<option value="money DESC">余额</option>
        <option value="gold DESC">金币</option>
        <option value="grade DESC">积分</option>
    </select>
    <input type="submit" value="搜索" class="btn btn-success" />
    </form>
    
    <table class="tbs">
    	<thead>
    	<tr>
        <td width="50">ID</td>
        
        <td width="60">昵称</td>
		<td width="60">头像</td>
        <td width="70">电话</td>
        <td width="50">账户余额</td>
        <td width="50">金币</td>
        <td width="50">积分</td>
        <td width="30">状态</td>
        <td width="100">注册时间</td>
         
        <td width="100 ">操作</td>
        </tr>
       </thead> 
       {foreach item=c from=$data}
       <tr>
        <td>{$c.userid}</td>
         
        <td>{$c.nickname}</td>
		<td>
			<img src="{$c.user_head}.100x100.jpg" width="60" />
		</td>
        <td>{$c.telephone}</td>
        <td>{$c.money}</td>
        <td width="8%">{$c.gold}</td>
        <td width="8%">{$c.grade}</td>
        <td>
			<div url="/admin.php?m=user&a=status&ajax=1&userid={$c.userid}" class="{if $c.status eq 1}yes{else}no{/if} js-toggle-status"></div>
		</td>
        <td>{$c.createtime|cutstr:11}</td>
         
        <td> 
				<a href="/admin.php?m=user&a=password&userid={$c.userid}">修改密码</a>  
				<a href="/admin.php?m=user&a=add&userid={$c.userid}">编辑</a>  
        <a href="javascript:;" class="setLogin" url="/admin.php?m=user&a=login&userid={$c.userid}&ajax=1" >切换登陆</a>
        <br>
        <a href="/admin.php?m=recharge&a=man&userid={$c.userid}" >充值</a>
        <a href="/admin.php?m=gold_log&a=man&userid={$c.userid}">充金币</a>
         
        </td>
        </tr>
       {/foreach} 
    
    </table>
    {$pagelist}
    </div>
 {include file="footer.html"}
<script>
$(function(){
	$(".setLogin").on("click",function(){
		$.get($(this).attr("url"),function(data){
			skyToast('切换登录成功');
		});
	});
	
	$(".js-regmoney").on("click",function(){
		$.get("{$appadmin}?m=regmoney&a=set&ajax=1&userid="+$(this).attr("userid"),function(data){
			skyToast(data.message);
		},"json");
	})
})
</script>
</body>
</html>
